/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.p2psimulator.util;

/**
 *
 * @author Amorim
 */
public abstract class ProgressThread implements Runnable{

    protected  String currentActivity;
    protected  int totalActivity;
    protected  int currentActivityNumber;

    public ProgressThread(int totalActivity) {
        this.totalActivity = totalActivity;
    }
    public abstract void runProcess();

    public void run(){
        runProcess();
    }

    public int getCurrentProgress(){
        double status = (double) currentActivityNumber/totalActivity;
        status *= 100d;
        return new Double(status).intValue();
        
    }
    
    public String getCurrentActivity() {
        return currentActivity;
    }

    public void setCurrentActivity(String currentActivity) {
        this.currentActivity = currentActivity;
    }

    public int getCurrentActivityNumber() {
        return currentActivityNumber;
    }

    public void setCurrentActivityNumber(int currentActivityNumber) {
        this.currentActivityNumber = currentActivityNumber;
    }

    public int getTotalActivity() {
        return totalActivity;
    }

    public void setTotalActivity(int totalActivity) {
        this.totalActivity = totalActivity;
    }
}
